/**************************************
Author: Andrew Foote
Date: 06/17/2021
Updated: 1/25/24 by K Stange

Important note: need to set cd to file location: 
(e.g. .\Github\footestange_biaspaper\analysis_progs)
*************************************/

#delimit ; 
global graphdir "~\Documents\Github\footestange_biaspaper\paper\figures" ; 
global datadir "~\Documents\Github\footestange_biaspaper\disclosed_output";
set more off ; 
set scheme s2gcolor;
set scheme s1mono;

import delimited "$datadir\20230920\share_se_graphs_output_2023-09-12.csv", clear ;


/****************************
Making BA graph first
*****************************/
preserve ; 

keep if deglevl_code == 5;
twoway (connected round_only_se year_postgrad)
	(connected round_only_instate year_postgrad)
       (connected round_flag_se year_postgrad)
       (connected round_only_ui year_postgrad),
     xtitle("Year Post-Graduation")
     ytitle("Share Employed")
     legend(label(1 "Only Self-Emp") label(2 "In-State UI Only") label(3 "Self-Emp") label(4 "Only UI")) 
     ylabel(0(.1)1) yscale(range(0(0.1)1)) graphregion(fcolor(white))
     title("Share With National, Self-, and In-state Earnings" "Bachelors Graduates");
     
     graph export "$graphdir/share_se_ypg_bacc.png", replace; 
	 

gen share_migrate = round_only_ui-round_only_instate;

twoway (connected share_migrate year_postgrad)
	   (connected round_flag_se year_postgrad),
	   xtitle("Year Post-Graduation")
     ytitle("Share")
     legend(label(1 "Move Out-of-State") label(2 "Have Self-Employment") ) 
     ylabel(0(.1)1) yscale(range(0(0.1)1)) graphregion(fcolor(white))
     title("Share Migrate and Self-Employed");
     
     graph export "$graphdir/share_se_ypg_bacc2.png", replace; 
	 

restore ;


/*******************************
Then Associates
********************************/

preserve ; 

keep if deglevl_code == 3;
twoway (connected round_only_se year_postgrad)
	(connected round_only_instate year_postgrad)
       (connected round_flag_se year_postgrad)
       (connected round_only_ui year_postgrad),
     xtitle("Year Post-Graduation")
     ytitle("Share Employed")
     legend(label(1 "Only Self-Emp") label(2 "In-State UI Only") label(3 "Self-Emp") label(4 "Only UI")) 
     ylabel(0(.1)1) yscale(range(0(0.1)1)) graphregion(fcolor(white))
     title("Share With National, Self-, and In-state Earnings" "Associates Graduates");
     
     graph export "$graphdir/share_se_ypg_assoc.png", replace; 
	 
	 
restore ;
